package com.nommon.tool;

import android.graphics.Canvas;
import android.view.MotionEvent;

public abstract class BasicUIElement {
	
	private int x;
	private int y;
	private int w;
	private int h;
	
	public BasicUIElement(int x, int y, int w, int h){
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
	}
	
	public abstract void draw(Canvas canvas, int parentX, int parentY);
	
	public boolean onTouchEvent(MotionEvent event){
		return false;
	}
	
	protected boolean isInBounds(int pointX, int pointY){
		return pointX >= x && pointX < x+w && pointY >= y && pointY < y+h;
	}
	
	protected int getHight() {
		return h;
	}

	protected int getWidth() {
		return w;
	}
	protected int getY() {
		return y;
	}

	protected int getX() {
		return x;
	}
}
